//
//  TextReaderController.h
//  ChangJiangPress
//
//  Created by 泉 汉水 on 11-12-21.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "LeavesViewController.h"
#import "BookItem.h"
#import "DBUtil.h"


@interface TextReaderController : LeavesViewController <UITableViewDataSource, UITableViewDelegate>{
    NSMutableArray *pagesArray; //每页的起始位置数组
    NSMutableArray *categoryArray;//目录数组
    NSMutableArray *bookmarkArray;//标签数组
    
    int pageIndex; //当前页码
    int fontSize; //字体大小
    
    NSString *bookString;//图书字符串
    NSString *bookId;//图书编号
    NSString *bookFileName;//图书编号
    BookItem *bookItem;//图书信息类
    
	BOOL   m_bIsShowTool;
    
    UIView *mainToolbarView;
    UIButton *fontPlusButton;
    UIButton *fontMinusButton;
    UIView *categoryView;
    UIImageView *categoryBackground;
    UIButton *columnButton;
    UIButton *bookmarkColumnButton;
    UITableView *categoryTableView;
    UITableView *bookmarkTableView;
    UIView *pageSliderView;
    UISlider *pageSlider;
    UIView *bookInfoView;
    UIImageView *bookCoverView;
    UIButton *bookmarkButton;
    
    UIActivityIndicatorView *waitingView;
    
    int currentPage4HV;
    NSRange currentRange;
    
    CGRect txtContainerRect;
    CGSize paraSizeGlobal;
    int backgroundJobLock;
}
@property(nonatomic, retain) NSString *bookId;
@property(nonatomic, retain) NSString *bookFileName;
//@property(nonatomic, retain) BookItem *bookItem;
@property(nonatomic, retain) IBOutlet UIImageView *categoryBackground;
//@property(nonatomic, retain) IBOutlet UIView *pageSliderView;
//@property(nonatomic, retain) IBOutlet UISlider *pageSilder;

-(void) initExtend; 
-(void) calculatePageNewThread;
-(void) centerClick:(id)sender;
-(void) closeClick:(id)sender;

-(IBAction) categoryClick:(id)sender;
-(IBAction) gotoPageClick:(id)sender;
-(IBAction) fontChangeClick:(id)sender;
-(IBAction) bookmarkClick:(id)sender;
-(IBAction) categoryAndBookmarkClick:(id)sender;
-(void)getTextWidth:(NSString *)string;

@end
